package com.shijie.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import tk.mybatis.mapper.entity.Example;

import com.shijie.core.AbstractService;
import com.shijie.domain.entity.Menus;
import com.shijie.mapper.MenusMapper;
import com.shijie.utils.TreeUtil;

/*
 *  @author: smart boy
 *  @date: 2018-08-06
 */
@Service
public class MenusService extends AbstractService<Menus> {

	@Resource
	private MenusMapper menusMapper;
	public List<Menus> selectAllMenus(){
		Example con = new Example(Menus.class);
		con.createCriteria().andEqualTo("visible",0);
		List<Menus> menus = menusMapper.selectByCondition(con);
		return  TreeUtil.tree(menus);
	}
}
